package com.linzm.creationaltype.prototype05;

import com.linzm.creationaltype.prototype05.factory.ShapeCache;
import com.linzm.creationaltype.prototype05.shape.Shape;

/**
 * @Author zimingl
 * @Date 2023/4/15 21:05
 * @Description: PrototypePatternDemo
 */
public class PrototypePatternDemo {
    public static void main(String[] args) throws Exception {
        ShapeCache.loadCache();

        Shape clonedShape = ShapeCache.getShape("1");
        System.out.println("Shape : " + clonedShape.getType());
        System.out.println(clonedShape);
        System.out.println(clonedShape);

        Shape clonedShape2 = ShapeCache.getShape("2");
        System.out.println("Shape : " + clonedShape2.getType());

        Shape clonedShape3 = ShapeCache.getShape("3");
        System.out.println("Shape : " + clonedShape3.getType());
    }
}
